Skip to main content

Cloud_Based_SWMM_Rain_Data_Storage

Table Of Contents 

    1. Document

    2. Vision Summary

    3. Design Goals

    4. Functionality

        4.1 Feature Summary

        4.2 Data Storage

        4.3 Doppler

        4.4 Error Handling

 5. External Dependencies

 6. Additional Requests

1. Document

Created By: Melissa Conner
Created On: 10/29/2013

Revised On: 6/6/2014

2. Vision Summary

Build an application which allows for hourly updates of rainfall data for a specific location from NOAA website to be stored into the cloud SWMM table storage with a Partition key and a row key.  

3. Design Goals

Once an hour, updated rainfall data for a specific location will be sent to SWMM table storage so that the last 24 hours of rainfall can be retrieved when needed for SWMM simulations.

4. Functionality

4.1 Feature Summary

The method is setup to run every 15 (FREQUENCY_INTERVAL) minutes indefinitely. It collects rainfall at 15 minutes (CAPTURE_RAINFALL_THIS_MINUTE_EVERY_HOUR) past an hour and collects doppler images every 15 minutes. The observed and forecast rainfall is collected for list of rainfall stations with corresponding latitude and longitude. The radar images are downloaded for regions defined using array of string in resource - Properties.Settings.Default.DOPPER_QUADS_CVG. Each string in this array is a quadkey as explained by Bing map tile system - http://msdn.microsoft.com/en-us/library/bb259689.aspx Currently list of rainfall stations are hardcoded to KLUK and KCVG Currently the strings in Properties.Settings.Default.DOPPER_QUADS_CVG are 032000133, 032001022. The forecast precipitation value is 6 hourly. The method splits the precipitation value to get hourly rainfall.

4.2 Data Storage

New rain data is stored in Table Storage once an hour. 24 hours of rain data are retrieved for the given model time for SWMM simulations.

Rainfall data is then gathered for the previous hour; the data is returned with the date and time attached. This date and time are set by the website, and the time is currently returned as eastern standard time (for the KCVG gage). The rainfall data is then sent to table storage where the Partition Key is the station where the rainfall data comes from and the Row Key is the date time stamp in the format ISO 8601 with time zone offset.

4.3 Doppler

The Doppler images are download from the following URL - http://nowcoast.noaa.gov. The bounding box is gotten from the quadkeys requested by the bing map using BingMapTilesUtility. The outer boundary for regions which will be scanned for doppler images is defined by an array of Strings in Properties.Settings.Default.DOPPER_QUADS_CVG. The doppler images are downloaded for each zoom level within the area defined by the outer boundry. The initial zoom level is set by the length of the quadkey in Properties.Settings.Default.DOPPER_QUADS_CVG. The scanning continues until the zoom level reaches BINGMAP_ZOOM_UPPERLIMIT. To further understand Bing map tile system - http://msdn.microsoft.com/en-us/library/bb259689.aspx. The default zoom level in this program is level 7 this contains 4 doppler images. Each level after that will have 4 times as many doppler images. (Level 7 = 4, Level 8 = 16, Level 9 = 64...) We are going up to the BINGMAP_ZOOM_UPPERLIMIT which is currently hard-coded as 12. 

4.4 Error Handling

This code has been updated to handle exceptions thrown by attempting to retrieve NDFD data and/or insert a value into table storage.

It will capture any exception thrown and attempt to store it into the Error Table, RainfallStorage partition with an ISO 8601 date time of the error time as the row key, in gqcstorage1's table storage. It will sleep for a minute before reattempting.

5. External Dependencies

Rainfall storage requires the following inputs to function properly:

  1. The location in latitude and longitude
  2. NOAA rain service website
    1. http://graphical.weather.gov/xml/sample_products/browser_interface/ndfdXMLclient.php?whichClient=NDFDgen&lat=39.1065&lon=-84.5039&product=time-series&begin=2004-01-01T00%3A00%3A00&end=2016-07-30T00%3A00%3A00&Unit=e&precipa_r=precipa_r

6. Additional Requests

 Visual Studio 2010 AZURE SDK 2.1
MVC 4 Project Template
Razor as View Engine